from typing import *


class Solution:
    def maximumBinaryString(self, binary: str) -> str:
        cnt = Counter(binary)
        if cnt["0"] == 0 or cnt["0"] == 1:
            return binary
        z = binary.index("0")
        return "1" * (z + cnt["0"] - 1) + "0" + "1" * (len(binary) - (z + cnt["0"]))


s = Solution()
print(s.maximumBinaryString("110111011110"))
